var __extends =
    (this && this.__extends) ||
    (function () {
      var e = function (t, o) {
        return (e =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (e, t) {
              e.__proto__ = t;
            }) ||
          function (e, t) {
            for (var o in t)
              Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
          })(t, o);
      };
      return function (t, o) {
        function r() {
          this.constructor = t;
        }
        if ("function" != typeof o && null !== o)
          throw new TypeError(
            "Class extends value " + String(o) + " is not a constructor or null"
          );
        e(t, o),
          (t.prototype =
            null === o
              ? Object.create(o)
              : ((r.prototype = o.prototype), new r()));
      };
    })(),
  MarqueeView = (function (e) {
    function t() {
      var t = e.call(this) || this;
      return (
        (t.panel_marquee.hScrollBarSkin = ""),
        t.btn_marqueer_close.on(Laya.Event.CLICK, t, t.onCloseMarqueer),
        t
      );
    }
    return (
      __extends(t, e),
      (t.showMarqueeView = function (e) {
        return (
          null == this.marqueeV && (this.marqueeV = new t()),
          (this.marqueeV.pos_x = -100),
          (Global.isShowMarquee = !0),
          this.marqueeV.recyleLook(e),
          this.marqueeV
        );
      }),
      (t.prototype.recyleLook = function (e) {
        var t = this.panel_marquee.getChildByName("label_marquee_content");
        (t.width = 20 * e.length + 200),
          (t.text = e),
          (this.panel_marquee.hScrollBar.value = 0),
          Laya.timer.loop(9, this, this.onPaoMaDengMethod);
      }),
      (t.prototype.onPaoMaDengMethod = function () {
        this.pos_x++;
        var e = this.panel_marquee.getChildByName("label_marquee_content");
        if (this.pos_x >= e.width + 5)
          return (
            (e.text = "播放完毕"),
            Laya.timer.clear(this, this.onPaoMaDengMethod),
            void this.removeSelf()
          );
        this.panel_marquee.hScrollBar.value = this.pos_x;
      }),
      (t.prototype.onCloseMarqueer = function () {
        (Global.startTime = new Date()),
          (Global.isShowMarquee = !1),
          Utils.countDownTriggerEvent(),
          Laya.timer.clear(this, this.onPaoMaDengMethod),
          this.removeSelf();
      }),
      t
    );
  })(ui.common.MarqueeViewUI);
